//
//  NotepadNavVC.m
//  NotepadApp
//
//  Created by yobet on 2018/4/12.
//  Copyright © 2018年 HJ. All rights reserved.
//

#import "NotepadNavVC.h"

@interface NotepadNavVC ()

@end

@implementation NotepadNavVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
    [self.navigationBar setBackgroundImage:[UIImage new] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
    [self.navigationBar setShadowImage:[UIImage new]];
    self.navigationBar.translucent = NO;
    self.navigationBar.barTintColor =  HJColor(26, 69, 75);
    self.navigationBar.tintColor = HJColorRGB(255);
    self.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: HJColorRGB(255), NSFontAttributeName:[UIFont boldSystemFontOfSize:18]};
}


- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (self.viewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
        viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStylePlain target:self action:@selector(back:)];
    }
    [super pushViewController:viewController animated:YES];
}

- (void)back:(UIBarButtonItem *)item {
    [self popViewControllerAnimated:YES];
}

-(void)backClicked:(UIButton *)btn {
    [self popViewControllerAnimated:YES];
}

@end
